# Contributor: Leon ROUX <leon.roux@federate.us>
# Maintainer: Leon ROUX <leon.roux@federate.us>
pkgname=glslviewer
pkgver=3.2.4
pkgrel=0
pkgdesc="Console-based GLSL Sandbox for 2D/3D shaders"
_vera="93b2496679c005a723d3e04327199602955ed1dc"
url="https://github.com/patriciogonzalezvivo/glslViewer"
license="BSD-3.0"
arch="all"
depends="
	"
makedepends="
	cmake
	ffmpeg-dev
	libx11-dev
	libxcursor-dev
	libxi-dev
	libxinerama-dev
	libxrandr-dev
	mesa-dev
	musl-dev
	samurai
	"
# ncurses-dev: disabled dependency because of upstream bug
source="$pkgname-$pkgver.tar.gz::https://github.com/patriciogonzalezvivo/glslViewer/archive/refs/tags/$pkgver.tar.gz
	vera-$_vera.tar.gz::https://github.com/patriciogonzalezvivo/vera/archive/$_vera.tar.gz
	"
builddir="$srcdir/glslViewer-$pkgver"
options="!check" # does not have any tests

prepare() {
	default_prepare

	rmdir deps/vera
	ln -sfv "$srcdir"/vera-$_vera \
		"$builddir"/deps/vera
}

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
20766ad1fe288d4e193849809b5633635b2d3a551cd46c9378f80c8817aeb90180847f2e9540e02f6c5729e0fa7fd51c45b4a1fa5f7e4ed6e397c58ef3e32c47  glslviewer-3.2.4.tar.gz
40cecbd9480f84141f1a22d7a0e730c408cc55729dd4f25d80c6f3fa8098a6e31f088b3b1bfacd3d1507a2bf093dffe3fdb9bc7cb05fdc5586a00bd6956dae16  vera-93b2496679c005a723d3e04327199602955ed1dc.tar.gz
"
